package com.ruoyi.project.system.shOperationLog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.shOperationLog.mapper.ShOperationLogMapper;
import com.ruoyi.project.system.shOperationLog.domain.ShOperationLog;
import com.ruoyi.project.system.shOperationLog.service.IShOperationLogService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 操作日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-28
 */
@Service
public class ShOperationLogServiceImpl implements IShOperationLogService 
{
    @Autowired
    private ShOperationLogMapper shOperationLogMapper;

    /**
     * 查询操作日志
     * 
     * @param id 操作日志ID
     * @return 操作日志
     */
    @Override
    public ShOperationLog selectShOperationLogById(Long id)
    {
        return shOperationLogMapper.selectShOperationLogById(id);
    }

    /**
     * 查询操作日志列表
     * 
     * @param shOperationLog 操作日志
     * @return 操作日志
     */
    @Override
    public List<ShOperationLog> selectShOperationLogList(ShOperationLog shOperationLog)
    {
        return shOperationLogMapper.selectShOperationLogList(shOperationLog);
    }

    /**
     * 新增操作日志
     * 
     * @param shOperationLog 操作日志
     * @return 结果
     */
    @Override
    public int insertShOperationLog(ShOperationLog shOperationLog)
    {
        shOperationLog.setCreateTime(DateUtils.getNowDate());
        return shOperationLogMapper.insertShOperationLog(shOperationLog);
    }

    /**
     * 修改操作日志
     * 
     * @param shOperationLog 操作日志
     * @return 结果
     */
    @Override
    public int updateShOperationLog(ShOperationLog shOperationLog)
    {
        shOperationLog.setUpdateTime(DateUtils.getNowDate());
        return shOperationLogMapper.updateShOperationLog(shOperationLog);
    }

    /**
     * 删除操作日志对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShOperationLogByIds(String ids)
    {
        return shOperationLogMapper.deleteShOperationLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除操作日志信息
     * 
     * @param id 操作日志ID
     * @return 结果
     */
    @Override
    public int deleteShOperationLogById(Long id)
    {
        return shOperationLogMapper.deleteShOperationLogById(id);
    }
}
